package com.ych.modules.cms.authorInfc.user.controller;

import com.ych.modules.base.dbEntity.TUserAccountEntity;
import com.ych.modules.common.service.UserAccountService;
import com.ych.utils.serviceReturn.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Author: Usopp.tsui
 * Date: 2020/12/31
 * Time: 15:07
 * Description:
 */
@RestController("cmsUserAccountController")
@RequestMapping("/cms/auth/user/account")
@Api(tags = {"CMS——用户account账户相关"}, description = "CMS——用户account账户相关", position = 2)
public class UserAccountController {
    @Autowired
    private UserAccountService userAccountService;

    @PostMapping("/getAccountInfo")
    @ApiOperation(value = "用户账户信息查询", notes = "用户账户信息查询")
    public R<TUserAccountEntity> getAccountInfo(@RequestBody String userId) {
        try {
            TUserAccountEntity accountEntity = userAccountService.getAccountInfo(userId);
            return new R(0, "成功", accountEntity);
        } catch (Exception e) {
            return new R(1, e.getMessage(), null);
        }
    }
}
